<?php
	$v_params = $this->getParams();
	$recurso = $v_params[0];
	$osAtiva = $_REQUEST["os"];
?>
<form name="formOS" id="formOS" method="post" action="./Atividade/inserirAtividade">
    <table class="formLayout lista">
    	<tr>
        	<td colspan="2">Selecione os recursos relacionados a esta OS<br> Mantenha a tecla CTRL pressionada
            para selecionar vários recursos.<p> &nbsp;</p>
			</td>
        </tr>
		<tr>
            <td><label for="no_recurso">Recurso<span class="required-icon">*</span>:</label></td>
            <td>
            	<input type="hidden" name="id_os" id="id_os" value="<?php echo $osAtiva; ?>" />
                <select multiple style="height:200px" name="id_recurso[]" required id="id_recurso">
                  <?php foreach($recurso as $r){ 
				  	$atv = (in_array($r["id_recurso"], $v_params[1])) ? ' disabled' : '';
				  ?> 
                  <option value="<?php echo $r["id_recurso"] ?>" <?php echo $atv; ?>><?php echo $r["no_recurso"]
				  ?></option>
                  <?php } ?>
                </select>
          </td>
      	</tr>
        <tr>
            <td colspan="2">Os campos marcados com <span class="required-icon">*</span> 
            são de preenchimento obrigatório</td>
        </tr>
        <tr>
            <td>
            	<input type="submit" name="enviar" value="Salvar" />
            </td>
            <td>
            	<a href="./OS/mostrarOS/?id=<?php echo $osAtiva; ?>" class="btn_laranja">Cancelar</a>
            </td>
        </tr>
    </table>
</form>